import 'package:baselib/utils/image_util.dart';
import 'package:baselib/widgets/comm_app_bar.dart';
import 'package:baselib/widgets/comm_textfield.dart';
import 'package:baselib/widgets/form_input_widget.dart';
import 'package:baselib/widgets/gradient_card_view.dart';
import 'package:baselib/widgets/gradient_text_widget.dart';
import 'package:baselib/widgets/inkwell_button.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:framelib/utils/color_util.dart';
import 'package:framelib/utils/drawable_util.dart';
import 'package:framelib/utils/px_util.dart';
import 'package:framelib/utils/string_util.dart';
import 'package:framelib/widgets/comm_widget_manager.dart';
import 'package:framelib/widgets/main_gradient_button.dart';
import 'package:framelib/widgets/page_widget.dart';
import 'package:get/get.dart';
import 'package:module_business/module_my/viewmodel/edit_signature_view_model.dart';
/**
 * 个性签名主页
 */
class EditSignaturePage extends GetWidget<EditSignatureViewModel> {
  const EditSignaturePage({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return PageWidget.build(
        builder: (EditSignatureViewModel model){
          return PageWidget.PageScaffoldWidget(
            isShowBg: true,
            appBar: CommAppBar(
              backgroundColor: ColorUtil.instance.color_transparent,
              titleStr: StringUtil.instance.Signature,
              titleTextStyle: TextStyle(
                fontSize: PxUtil.instance.px_18,
                color: ColorUtil.instance.color_white,
                fontWeight: FontWeight.bold
              ),
              actions: [
                InkWellButton(
                  onPressed: ()=>model.save(),
                  child: Container(
                    padding: EdgeInsets.only(
                      left: PxUtil.instance.px_15,
                      right: PxUtil.instance.px_15,
                    ),
                    child: ImagesUtil.loadAssetImage(
                        DrawableUtil.instance.icon_room_set_save,
                        width: PxUtil.instance.px_36,
                        fit: BoxFit.fitWidth
                    ),
                  ),
                )
              ],
            ),
            body: Container(
              child: GradientCardView(
                elevation: PxUtil.instance.px_0,
                margin: EdgeInsets.only(
                  left: PxUtil.instance.px_15,
                  right: PxUtil.instance.px_15,
                  top: PxUtil.instance.px_12,
                ),
                borderRadius: BorderRadius.circular(PxUtil.instance.px_10),
                child: Container(
                  decoration: BoxDecoration(
                    color: ColorUtil.instance.color_2F4072,
                    borderRadius: BorderRadius.circular(PxUtil.instance.px_10),
                  ),
                  child: FormInputWidget(
                    title: '',
                    fontColor: ColorUtil.instance.color_white,
                    contentPadding: EdgeInsets.only(
                      left: PxUtil.instance.px_12,
                      right: PxUtil.instance.px_12,
                      top: PxUtil.instance.px_10,
                      bottom: PxUtil.instance.px_10,
                    ),
                    defaultCont: model.signature??'',
                    hintText: '${StringUtil.instance.Please_enter}...',
                    hintFontColor: ColorUtil.instance.color_half_white,
                    height: PxUtil.instance.px_148,
                    borderColor: ColorUtil.instance.color_transparent,
                    onChanged: (value) => model.inputChange(value),
                  ),
                ),
              ),
            ),
          );
        }
    );
  }
}
